//
//  MyHouseInfoBottomCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2018/1/3.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "MyHouseInfoBottomCell.h"

@interface MyHouseInfoBottomCell ()
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIButton *leftBtn;
@property (weak, nonatomic) IBOutlet UIButton *rightBtn;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;
@property (weak, nonatomic) IBOutlet UIButton *payBtn;


@end

@implementation MyHouseInfoBottomCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.bgView.backgroundColor = [UIColor whiteColor];
    
    self.bottomMargin.constant = 0;
    
    [self.leftBtn setTitleColor:themeColor forState:UIControlStateNormal];
    [self.leftBtn setTitleColor:themeColor forState:UIControlStateHighlighted];
    
    [self.rightBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [self.rightBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateHighlighted];
    
    [self.payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
    
    self.leftBtn.titleLabel.font = MYFONT(14);
    
    self.rightBtn.titleLabel.font = MYFONT(14);
    
    self.payBtn.titleLabel.font = MYFONT(14);

    self.leftBtn.layer.borderColor = themeColor.CGColor;
    
    self.leftBtn.layer.borderWidth = 0.6;
    
    self.leftBtn.layer.cornerRadius = 15;
    
    self.leftBtn.layer.masksToBounds = YES;
    
    
//    self.payBtn.layer.borderColor = themeColor.CGColor;
//
//    self.payBtn.layer.borderWidth = 0.6;
//
    self.payBtn.layer.cornerRadius = 15;

    self.payBtn.layer.masksToBounds = YES;
    
    self.payBtn.backgroundColor = themeColor;
  
    
    self.rightBtn.layer.borderColor = [UIColor orangeColor].CGColor;
    
    self.rightBtn.layer.borderWidth = 0.6;
    
    self.rightBtn.layer.cornerRadius = 15;
    
    self.rightBtn.layer.masksToBounds = YES;

    // Initialization code
}


- (void)setModel:(HouseParameterModel *)model{
    _model = model;
    
    
    if ([_model.pay_status isEqualToString:@"0"]) {
        
        self.payBtn.hidden = NO;
        
    } else {
        
        self.payBtn.hidden = YES;

    }
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
//- (void)editBtnDidClickWith:(NSIndexPath *)index;
//- (void)deleBtnDidClickWith:(NSIndexPath *)index;
- (IBAction)leftBtnDidTap:(UIButton *)sender {
    
    if ([self.delegate respondsToSelector:@selector(editBtnDidClickWith:)]) {
        [self.delegate editBtnDidClickWith:self.index];
    }
}
- (IBAction)rightBtnDidTap:(UIButton *)sender {
    
    
    if ([self.delegate respondsToSelector:@selector(deleBtnDidClickWith:)]) {
        [self.delegate deleBtnDidClickWith:self.index];
    }
    
}
- (IBAction)payBtnDidTap:(UIButton *)sender {
    
    if ([self.delegate respondsToSelector:@selector(payBtnDidClickWith:)]) {
        [self.delegate payBtnDidClickWith:self.index];
    }
}

@end
